﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TestEntityFramework.Entities;
using TestEntityFramework.Interfaces;
using TestEntityFramework.Model;

namespace TestEntityFramework.DAOS
{
    public class DAOSubTareas : IDAOSubTareas
    {
        private PGIngresoTareasEntities DBContext { get; set; }
        private RepositoryContext RepositoryContext { get; set; }

        public DAOSubTareas(PGIngresoTareasEntities dbContext, RepositoryContext repositoryContext)
        {
            DBContext = dbContext;
            RepositoryContext = repositoryContext;
        }

        public void insert(SubTarea ingresoHoras)
        {
            
        }

        public bool member(int code)
        {
            throw new NotImplementedException();
        }
        public void delete(int code)
        {
            throw new NotImplementedException();
        }
        public SubTarea find(int code)
        {
            throw new NotImplementedException();
        }

        public List<SubTarea> GetSubTareasPorTarea(int idTarea)
        {
            return DBContext.Tareas.Where(tarea => tarea.IdTarea == idTarea).First().SubTareas.ToList();
        }
    }
}
